home *** CD-ROM | disk | FTP | other *** search
-
-
-
- UUUUSSSSCCCCAAAASSSS((((3333PPPP)))) UUUUSSSSCCCCAAAASSSS((((3333PPPP))))
-
-
-
- NNNNAAAAMMMMEEEE
- uscas, uscas32 - compare and swap operator
-
- CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<uuuulllloooocccckkkkssss....hhhh>>>>
-
- iiiinnnntttt uuuussssccccaaaassss((((vvvvooooiiiidddd ****ddddeeeessssttttpppp,,,, ppppttttrrrrddddiiiiffffffff____tttt oooolllldddd,,,, ppppttttrrrrddddiiiiffffffff____tttt nnnneeeewwww,,,, uuuussssppppttttrrrr____tttt ****uuuu))));;;;
- iiiinnnntttt uuuussssccccaaaassss33332222((((vvvvooooiiiidddd ****ddddeeeessssttttpppp,,,, iiiinnnntttt33332222____tttt oooolllldddd,,,, iiiinnnntttt33332222____tttt nnnneeeewwww,,,, uuuussssppppttttrrrr____tttt ****uuuu))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _u_s_c_a_s emulates a hardware compare and swap instruction. It works on both
- single and multi-processor machines. The exact algorithm used depends on
- the chip and system type. _u_s_c_a_s checks that the contents of _d_e_s_t_p are
- equal to _o_l_d and if they are, atomically changes the contents of _d_e_s_t_p to
- _n_e_w. If the contents are not the same, a zero is returned and the
- operation may be repeated. Note that even with one process performing
- this algorithm, the compare and swap operation may fail, so the caller
- must always be prepared to loop. _u points to a previously set up arena
- (using _u_s_i_n_i_t(3P)).
-
- _u_s_c_a_s does a compare and swap on 32-bits for 32-bit processes and 64-bits
- for 64-bit processes.
- _u_s_c_a_s_3_2 does a compare and swap on 32-bits regardless of the type of the
- process.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- acquire_lock(3), usinit(3P), ussetlock(3P), uspsema(3P).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- A value of 1 returned when a successful compare and swap has been
- performed. Otherwise 0 is returned. There are no errors.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-